﻿@{
    ViewBag.Title = "OutSporadicIndex";
    Layout = "~/Views/Shared/_Layout.cshtml";    
}
@section Head
{
    <script type="text/javascript">
        var mainheight = document.documentElement.clientHeight;
        var mainWidth = document.documentElement.clientWidth;
        $(document).ready(function () {
            var otherpm = $("#title").height() + $("#findDiv").height(); // 290;
            var gh = mainheight - otherpm - 60;
            var pyy = $("#outstockyy :selected").text();
            var option = {
                height: gh,
                width: mainWidth,
                url: '@Url.Action("BuliderReportOutSporadic")',
                colModel: [
                    { display: '零星物品ID', name: 'ID', width: 60, sortable: false, align: 'left', hide: false, iskey: true },
                    { display: '零星物品编号', width: 120, sortable: false, hide: false, align: 'left' },
                    { display: '零星物品名称', width: 120, sortable: false, hide: false, align: 'left' },
			        { display: '1', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '2', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '3', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '4', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '5', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '6', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '7', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '8', width: 50, sortable: false, hide: true, align: 'left' },
                    { display: '9', width: 50, sortable: false, hide: true, align: 'left' },
			        { display: '10', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '11', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '12', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '13', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '14', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '15', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '16', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '17', width: 50, sortable: false, hide: true, align: 'left' },
                    { display: '18', width: 50, sortable: false, hide: true, align: 'left' },
			        { display: '19', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '20', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '21', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '22', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '23', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '24', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '25', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '26', width: 50, sortable: false, hide: true, align: 'left' },
                    { display: '27', width: 50, sortable: false, hide: true, align: 'left' },
			        { display: '28', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '29', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '30', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '31', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '合计', width: 50, sortable: false, hide: false, align: 'left' }
				],
                singleselected: true,
                sortname: "Sequence",
                sortorder: "asc",
                title: false,
                usepager: true,
                page: 1,
                rp: 20,
                rpOptions: [10, 15, 20],
                showcheckbox: true,
                rowbinddata: true,
                query: pyy + "," + $("#outstockmm").val() + "," + $("#LeanDept :selected").val()
            };
            $("#outstockspoadic").flexigrid(option);

            $("#btnQueryList").click(function () {
                option.query = $("#outstockyy :selected").text() + "," + $("#outstockmm").val() + ","
                             + $("#LeanDept :selected").val();
                option.newp = 0;
                $("#outstockspoadic").flexOptions(option).flexReload();
            });
            $("#btnExport").click(function () {
                var yy = $("#outstockyy :selected").text();
                var mm = $("#outstockmm").val();
                var st = $("#LeanDept :selected").val()
                var strulr = "OutstockSporadic?yy=" + yy + "&mm=" + mm + "&st=" + st;
                var subwin = window.open(strulr, "", "menubar=no,toolbar=no,status=no,resizable=no,scrollbars=yes");
                subwin.moveTo(0, 0);
                subwin.resizeTo(window.screen.availWidth, window.screen.availHeight);
                return false;
            });
        });
    </script>
}
<div id="container">
    <div id="mainContent">
        <div id="title" class="title">
            食堂零星物品领用表</div>
        <div id="findDiv">
            <table>
                <tr>
                    <td style="text-align: right; width: 80px;">
                        年份：
                    </td>
                    <td>@Html.DropDownList("outstockyy",
                                   ViewData["yy"] as IEnumerable<SelectListItem>,
                                   new { @style = "width:80px; height:22px; font-size:13px;" })
                    </td>
                    <td style="text-align: right; width: 80px;">
                        月份：
                    </td>
                    <td>@Html.DropDownList("outstockmm",
                                   ViewData["mm"] as IEnumerable<SelectListItem>,
                                   new { @style = "width:80px; height:22px; font-size:13px;" })
                    </td>
                    <td style="text-align: right;">
                        食堂
                    </td>
                    <td>@Html.DropDownList("LeanDept",
                                   ViewData["canteen"] as IEnumerable<SelectListItem>,
                                   new { @style = "width:150px; height:22px; font-size:13px;" })
                    </td>
                    <td>
                        <a id="btnQueryList" class="button" href="javascript:void(0);"><span>查 询</span></a>
                        <a id="btnExport" class="button" href="javascript:void(0);"><span>导 出</span></a>
                    </td>
                </tr>
            </table>
        </div>
        <table id="outstockspoadic" style="display: none;">
        </table>
    </div>
</div>
